class Gold extends egret.DisplayObjectContainer{
    private static cacheDict:Object = {};
    /**生产*/
    public static produce(textureName:string):Gold{
        if(Gold.cacheDict[textureName]==null)
            Gold.cacheDict[textureName] = [];
        var dict:Gold[] = Gold.cacheDict[textureName];
        var gold:Gold;
        if(dict.length>0) {
            gold = dict.pop();
        } else {
            gold = new Gold(RES.getRes(textureName));
        }
        return gold;
    }
    /**回收*/
    public static reclaim(bullet:Gold):void{
            var textureName: string = bullet.textureName;
        if(Gold.cacheDict[textureName]==null)
            Gold.cacheDict[textureName] = [];
        var dict:Gold[] = Gold.cacheDict[textureName];
        if(dict.indexOf(bullet)==-1)
            dict.push(bullet);
    }

    private textureName:string;//可视为子弹类型名

    public constructor(textureName: string) {
        super();
        this.textureName = textureName;
    }

    /**创建子弹*/
    private createBullet(evt:egret.TimerEvent):void {
        this.dispatchEventWith("create");
    }
}